<template>
  <div class="swipe">
    <van-swipe-cell :right-width="90" :disabled="isDisable" v-for="(item, index) in objData" :key="index">
      <div class="cell-card">
        <div class="card-lt">
          <img src="@img/file.png" alt="" />
        </div>
        <div class="card-ct">
          <div class="ct-head">{{ item.title }}</div>
          <div class="ct-time">
            <span>{{ item.time }}</span>
            <span>{{ item.senced }}</span>
          </div>
        </div>
        <!-- <div class="card-rt">00:22:33</div> -->
      </div>
      <template #right>
        <div class="removeItem">
          <van-icon name="delete-o" color="#fff" size="16" />
          <div class="remove-title">删除笔记</div>
        </div>
      </template>
    </van-swipe-cell>
  </div>
</template>

<script>
export default {
  props: {
    objData: {
      type: Array,
      default: () => {},
    },
    isDisable: Boolean, //true 禁用滑动 false 开启滑动
  },
  data() {
    return {};
  },
};
</script>
<style scoped lang="scss">
.cell-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 13px 8px;
  display: flex;
  margin-bottom: 12px;
  .card-lt {
    width: 30px;
    height: 30px;
    img {
      width: 100%;
      height: 100%;
      margin-top: 6px;
    }
  }
  .card-ct {
    flex: 1;
    padding-left: 9px;
    .ct-head {
      font-family: PingFangSC, PingFang SC;
      font-weight: 500;
      font-size: 16px;
      color: #272b2d;
      line-height: 22px;
      text-align: left;
      font-style: normal;
      padding-bottom: 8px;
    }
    .ct-time {
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      font-size: 12px;
      color: #676b6b;
      line-height: 17px;
      text-align: left;
      font-style: normal;
      display: flex;
      justify-content: space-between;
    }
  }
  .card-rt {
    width: 50px;
    height: 17px;
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 12px;
    color: #676b6b;
    line-height: 17px;
    text-align: left;
    font-style: normal;
  }
}
.removeItem {
  background: #ffa940;
  border-radius: 0px 4px 4px 0px;
  height: 100%;
  text-align: center;
  padding: 15px 16px 16px 18px;
  .remove-title {
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #ffffff;
    line-height: 20px;
    font-style: normal;
  }
}
</style>
